Repository navigation
Reconcile admitted fragment inventory after restart - #316
Merged
Merged
Conversation
Exohayvan
marked this pull request as ready for review
October 12, 2026 00:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After restart, a durable admission record can still say verified_observation even when its selected file has disappeared or changed. Add a bounded read-only reconciliation pass that rechecks every admitted request against explicit local file selections and caller-pinned manifest bindings.
The complete selection and aggregate logical read budget are validated before opening fragments. Each observation is verified, missing or unverified; the pass preserves all charges, records and files. Callback exceptions abort even when they resemble file errors. A changed ledger snapshot rejects the whole report. No partial report, scan of unknown files, deletion, repair, serving capability, publisher authority or future retention claim is introduced.
This is a recovery decision input for trusted local callers, not an owned retained store. File observations are sequential rather than an atomic filesystem snapshot. Existing trusted-directory and same-user limits apply. Logical reads are capped at 64 MiB over at most 192 admitted requests using the existing 32 KiB verifier; this is not a physical-I/O/CPU/RSS bound. Synchronous SQLite operations retain the existing busy timeout. No runtime dependencies or schema changes.
Validation includes restart with stale verified metadata plus missing/corrupt files, aggregate preflight before file I/O, symlink/FIFO/read failures, cancellation exception propagation, actual read accounting, and ledger changes from another connection and a separate process during a file read. Installed-package smoke reopens the ledger, verifies an existing file, removes the ephemeral fixture and confirms missing bytes remain charged. Native fast gate passed: 1,235 tests and 1,930 subtests, warning-free, including coverage, lint/format, strict typing and policy checks. Eight focused Python 3.11 tests also passed with ResourceWarning treated as an error. All 24 fresh hosted checks passed on this exact head, including build/install acceptance. Mutation is not run; existing coverage exclusions apply.
Keep this draft unmerged pending independent review. Durable ingestion/path ownership, writer fencing, orphan accounting, safe reclamation and repair remain future steps.
Exact review head:
ff29892ea4ebb30cf6c51018fe52d4052ce86145; tree8389ffbcfdae0b0943e4f9f55bf3bd497450ff31. Base: merged PR314834023b1c45d223a9a6830cc58b4c60f06fc6675. The final tree was unchanged when aligning the feature commit with the squash-merged parent.